import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

const router = new Router({
  routes: [
    {
      path: '/',
      redirect: '/index/'
    },
    {
      path: '/index',
      component: resolve => require(['@/views/index.vue'], resolve),
      children: [
        {
          path: '/',
          redirect: '/global/'
        },
        {
          // 全局的方法
          path: '/global',
          name: 'global',
          component: resolve => require(['@/views/global'], resolve)
        },
        {
          // 全局的样式
          path: '/css',
          name: 'css',
          component: resolve => require(['@/views/css'], resolve)
        },
        {
          // 全局的样式
          path: '/auth',
          name: 'auth',
          component: resolve => require(['@/views/auth'], resolve)
        },
        {
          // 全局的样式
          path: '/scss',
          name: 'scss',
          component: resolve => require(['@/views/scss'], resolve)
        },
        {
          // 表格
          path: '/table',
          name: 'table',
          component: resolve => require(['@/views/table'], resolve)
        },
        {
          // 文件列表
          path: '/fileList',
          name: 'fileList',
          component: resolve => require(['@/views/fileList'], resolve)
        },
        {
          // 时间组件
          path: '/date',
          name: 'date',
          component: resolve => require(['@/views/date'], resolve)
        },
        {
          // 树组件
          path: '/tree',
          name: 'tree',
          component: resolve => require(['@/views/tree'], resolve)
        },
        {
          // 树组件
          path: '/projectRetrieve',
          name: 'projectRetrieve',
          component: resolve => require(['@/views/projectRetrieve'], resolve)
        },
        {
          // 复选框
          path: '/check',
          name: 'check',
          component: resolve => require(['@/views/check'], resolve)
        },
        {
          // 用户头像
          path: '/userEX',
          name: 'userEX',
          component: resolve => require(['@/views/user'], resolve)
        },
        {
          // 下拉选择框
          path: '/editor',
          name: 'editor',
          component: resolve => require(['@/views/editor'], resolve)
        },
        {
          // 下拉选择框
          path: '/select',
          name: 'select',
          component: resolve => require(['@/views/select'], resolve)
        },
        {
          path: '/nav',
          name: 'nav',
          component: resolve => require(['@/views/nav'], resolve)
        },
        {
          // 弹窗
          path: '/dialog',
          name: 'dialog',
          component: resolve => require(['@/views/dialog'], resolve)
        },
        {
          // 搜索
          path: '/search',
          name: 'search',
          component: resolve => require(['@/views/search'], resolve)
        },
        {
          // 搜索
          path: '/searchAd',
          name: 'searchAd',
          component: resolve => require(['@/views/searchAd'], resolve)
        },
        {
          // 输入框
          path: '/talk',
          name: 'talk',
          component: resolve => require(['@/views/talk'], resolve)
        },
        {
          // 预览
          path: '/preview',
          name: 'preview',
          component: resolve => require(['@/views/preview'], resolve)
        },
        {
          path: '/retrieve',
          name: 'retrieve',
          component: resolve => require(['@/views/retrieve'], resolve)
        },
        {
          path: '/message',
          name: 'message',
          component: resolve => require(['@/views/message'], resolve)
        },
        {
          path: '/messageBox',
          name: 'messageBox',
          component: resolve => require(['@/views/messageBox'], resolve)
        },
        {
          path: '/paginate',
          name: 'paginate',
          component: resolve => require(['@/views/paginate'], resolve)
        },
        {
          path: '/report',
          name: 'report',
          component: resolve => require(['@/views/report'], resolve)
        },
        {
          path: '/auto',
          name: 'auto',
          component: resolve => require(['@/views/auto.vue'], resolve)
        },
        {
          path: '/host',
          name: 'host',
          component: resolve => require(['@/components/host/host.vue'], resolve)
        },
        {
          path: '/upload',
          name: 'upload',
          component: resolve => require(['@/views/upload.vue'], resolve)
        },
        {
          path: '/uploadGold',
          name: 'uploadGold',
          component: resolve => require(['@/views/uploadGold.vue'], resolve)
        },
        {
          path: '/weibo',
          name: 'weibo',
          component: resolve => require(['@/views/weibo.vue'], resolve)
        },
        {
          path: '/cooperator',
          name: 'cooperator',
          component: resolve => require(['@/views/cooperator.vue'], resolve)
        },
        {
          path: '/treeGrid',
          name: 'treeGrid',
          component: resolve => require(['@/views/treeGrid.vue'], resolve)
        }
      ]
    }
  ]
})

export default router
